package com.example.demo.dao;

import com.example.demo.model.UserModer;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
  @Select("select id,name,password from user")
  List<UserModer> select();

  @Insert("insert into login(name) values(#{name})")
  int insert(@Param("name") String name);

  @Select("select id,name,password from user where name= #{name} and password= #{password} ")
  List<UserModer> checkUser(@Param("name") String name, @Param("password") String password);
}
